﻿using System.Diagnostics;

namespace DbBackupAssist.Extensions
{
    public static class FolderExtension
    {
        public static void ShareFolder(string shareName, string shareFolderPath)
        {
            Process p = new Process();
            p.StartInfo.FileName = "cmd.exe";
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.Arguments = $"/c net share {shareName}={shareFolderPath} ";
            p.Start();
            p.WaitForExit();
        } 
    }
}
